#读取yaml文件
import yaml
import os
import getpathinfo

class ReadYaml(object):
    def __init__(self,filename):
        path = getpathinfo.get_path()#获取根目录
        self.filepath = os.path.join(path,"data","test_data")+"/"+filename

    def get_yaml_data(self):
        with open(self.filepath,"r",encoding="utf-8") as f:
            #调用load方法返回文件流
            return yaml.load(f,Loader=yaml.FullLoader)


